package com.irs.irsforum.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.irs.irsforum.entity.Student;
import com.irs.irsforum.mapper.StudentMapper;
import com.irs.irsforum.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author yihuili
 * @since 2020-01-19
 */
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements IStudentService {

    @Autowired
    StudentMapper studentMapper;

    @Override
    public Boolean isExistStudentId(Long studentId) {
        boolean isExist = studentMapper.isExistStudentId(studentId) == 1 ? true : false;
        return isExist;
    }

    @Override
    public Student getStudentById(Long studentId) {
        Student student = studentMapper.getStudentById(studentId);
        return student;
    }
}
